
angular.module('starter', ['ionic', 'homeModule','buyblockModule','dressModule','goodDetailModule',"fashionModule",'dressmanualMo', 'suitDetailModule','searchModule','navbutton','popModule','liveingModule',
'loginModule','ion-affix'])

	.run(function($ionicPlatform) {
		$ionicPlatform.ready(function() {
			// Hide the accessory bar by default (remove this to show the accessory bar above the keyboard
			// for form inputs)
			if(window.cordova && window.cordova.plugins && window.cordova.plugins.Keyboard) {
				cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
				cordova.plugins.Keyboard.disableScroll(true);

			}
			if(window.StatusBar) {
				// org.apache.cordova.statusbar required
				StatusBar.styleDefault();
			}
		});
	})

	.config(function($stateProvider, $urlRouterProvider) {

		$stateProvider
			.state('home', {
				url: '/home',
				templateUrl: 'templates/home/home.html',
				controller: 'DashCtrl'
			})
			.state('buyblock', {
				url: '/buyblock/:Id',
				templateUrl: 'templates/buyblock/buyblock.html',
				controller: 'buyblockCtrl',

			})
			.state('goodslist/:detail', {
				url: '/buyblock/goodslist/:detail',
				templateUrl: 'templates/goodDetail/goodDetail.html',
				controller: 'goodDetailCtrl',
			})
			//fashion
			.state('fashion', {
				url: '/fashion/:Id',
				templateUrl: 'templates/fashion/fashion.html',
				controller: 'fashionCtrl',
			})
			.state('dress', {
				url: '/dress/:tag',
				templateUrl: 'templates/dress/dress.html',
				controller: 'dressCtrl',
				//				parent:'home'
			})
			.state('dressmanual', {
				url: '/dressmanual/:id',
				templateUrl: 'templates/dress_manual/dress_manual.html',
				controller: 'dressmanualCtrl',
			})
			.state('suitdetail', {
				url: '/suitDetail/:userId/:suitId',				
				templateUrl: 'templates/suitDetail/suitDetail.html',
				controller: 'suitDetailCtrl',

			})
			.state('search', {
				url: '/search/:d',				
				templateUrl: 'templates/search_result/search.html',
				controller: 'searchCtrl',

			})
			.state('live', {
				url: '/live/:mediaId',
				templateUrl: 'templates/live/liveing.html',
				controller: 'liveCtrl'
			})
 			.state('pop', {
				url: '/pop/:cardId',
				templateUrl: 'templates/pop/pop.html',
				controller: 'popCtrl'
			})
 			.state('login', {
				url: '/login',
				templateUrl: 'templates/login/login.html',
				controller: 'loginCtrl'
			})


		// if none of the above states are matched, use this as the fallback
		$urlRouterProvider.otherwise('/home');

	});
	
	